Explicit Time Marching Scheme

In this example, we will solve the 1D heat equation

$\dfrac{\partial T}{\partial t} = \kappa \dfrac{\partial^2 T}{\partial x^2}$, with $\kappa = 1$

subject to the following boundary conditions:

To do this, we use the explicit time marching scheme. For this problem, the stability condition is

$\Delta t=\nu \dfrac{\Delta x^2}{2 \kappa}$, where $\nu \leq 1$ is the Courant number.

In the figures below, we vary $\Delta t$ and $\Delta x$ to see the effect on the solution.

Use the sliders to determine which values of $\Delta t$ and $\Delta x$ lead to stable solutions.


Fist, we change $\Delta t$ while keeping $\Delta x = 0.01$ fixed:



Next, we change $\Delta x$ while keeping $\Delta t = 5 \times 10^{-5}$ fixed: